// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import { SceneBase,state,langMgr,packMgr,uiMgr,protocols,UIAnimation } from 'lcc';
import { _decorator,sys, Component } from 'cc';
const {ccclass, executeInEditMode, menu} = _decorator;

@ccclass('TestScene')
@menu('TEST/TestScene')
export default class TestScene extends Component {

    // onLoad () {}

    async start(){
        if(!state.initialized){
            await state.initialize();
            let lang = sys.localStorage.getItem('test.lang') || 'zh';
            await langMgr.setLanguage(lang);
            await packMgr.loadPack('resources');
            if(sys.localStorage.getItem('test.pack.local') == 'true'){
                await packMgr.loadPack('test-local');
            }
            if(sys.localStorage.getItem('test.pack.remote') == 'true'){
                await packMgr.loadPack('http://localhost:4568/test-remote');
            }
        }
        uiMgr.openUI('ui-top-menu');
        //uiMgr.pushUI('ui-test-list');
    }
    // update (dt) {}
}
